home *** CD-ROM | disk | FTP | other *** search
- Path: rz.uni-karlsruhe.de!ma2s2!haible
- From: haible@ma2s2.mathematik.uni-karlsruhe.de (Bruno Haible)
- Newsgroups: comp.lang.lisp,comp.lang.c++
- Subject: Re: Why garbage collection?
- Date: 11 Feb 1996 01:15:33 GMT
- Organization: University of Karlsruhe, Germany
- Message-ID: <4fjfvl$nps@nz12.rz.uni-karlsruhe.de>
- References: <hbaker-2201961503250001@10.0.2.15> <4eae5s$66p@nz12.rz.uni-karlsruhe.de> <822675271snz@wildcard.demon.co.uk> <DM09G0.MzG.0.macbeth@cogsci.ed.ac.uk>
- NNTP-Posting-Host: ma2s2.mathematik.uni-karlsruhe.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- Keywords: costs, low-level
- Originator: haible@ma2s2
-
- Jeff Dalton <jeff@cogsci.ed.ac.uk> wrote:
-
- >>> Just look at the technical strength of the argument that GC is not
- >>> "in the tradition of the C community"...
- >>
- >>Yeah, I love it. ;-)
- >
- > But it _is_ true that GC is not in the tradition of the C community.
- > The argument that it's a "hidden cost" is key here. C programmers
- > feel that they know what everything will do in machine terms, and
- > to a fair extent they are right. (That's so despite a number of
- > difficulties and exceptions.)
- >
- > So when a allocation might do lots of collecting as well (or
- > whatever), and you don't really know when, that seems to move
- > C into the higher-level / less-in-touch-with-the-machine camp.
-
- But apparently more and more C programmers learn and use C++. This
- language also has hidden costs here and there:
-
- - An assignment may involve more than moving around memory words,
-
- - A method (a.k.a. "member function") call usually involves two
- pointer accesses and two branches additionally to the C function
- call,
-
- - Virtual inheritance introduces hidden pointers within the objects,
-
- - Exception handling adds tables whose size is comparable to the
- size of the code,
-
- and this is silently accepted by the C++ community. Exceptions
- haven't been in the C tradition either, yet they are very welcome
- in the C++ community. In fact, the C++ programmers are pushing the
- C++ compiler vendors to implement these things.
-
- So: why had the GC to wait for the arrival of Java until it became
- widely accepted?
-
-
- Bruno Haible email: <haible@ilog.fr>
- Software Engineer phone: +33-1-49083585
-
-